package string;

public class IndexOfDemo {
    public static void main(String[] args){
        String str="thinking in java";
        int indexFirst=str.indexOf("in");
        System.out.println(indexFirst);
        int indexLast=str.lastIndexOf("in");
        System.out.println(indexLast);
        int index=str.indexOf("in",3);
        System.out.println(index);
        int index2=str.indexOf("ina");
        System.out.println(index2);
        int index3=str.indexOf("java");

    }
}
